/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.flexengine.math;

/**
 * @author Luann R. Athayde
 * @version 1.0
 * @since 1.0
 */
public class Cylinder extends Form3D {
    
    private float radius;
    private float height;

    public float getRadius() {
        return radius;
    }

    public void setRadius(float radius) {
        this.radius = radius;
    }

    public float getHeight() {
        return height;
    }

    public void setHeight(float height) {
        this.height = height;
    }

    @Override
    public float getVolume() {
        return (float)(Math.PI * radius * radius * height);
    }
    @Override
    public float getArea() {
        return getTotalArea();
    }
    
    public float getBaseArea() {
        return (float) (Math.PI * radius * radius);
    }
    public float getSideArea() {
        return (float) (2f * Math.PI * radius * height);
    }
    /**
     * Same that getArea...
     * @return 
     */
    public float getTotalArea() {
        return (2f*getBaseArea()+getSideArea());
    }
    
    
    @Override
    public String toString() {
        return getName()+"{" + "x=" + 
                getX() + ", y=" + getY() + ", z=" + getZ() + ", radius=" + radius + ", height=" + height + '}';
    }   
    
}
